<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="./css/list.css"/>
<link rel="stylesheet" type="text/css" href="./css/index.css"/>
<link rel="stylesheet" type="text/css" href="./common/jquery/pagination.css"/>
<script src="./common/jquery/jquery-1.3.2.min.js" type="text/javascript"></script><!--加载jQuery库-->
<script type="text/javascript" src="./common/jquery/jquery.pagination.js"></script>
<script src="./common/jquery/jquery.form.min.js" type="text/javascript"></script><!--加载jQuery库-->
<script type="text/javascript" src="./common/common.js"></script>
<script type="text/javascript" src="./common/utils.js"></script>
<script type="text/javascript" src="./common/general.js"></script>
<script type="text/javascript" src="./common/index.js"></script>
<script type="text/javascript">
window.onload = function(){
	var userid = getUserid();
	$('#upload').bind('change',subFrm);
	$("#logout").bind('click',function(){
		$.post(foxit.common.path+'/UserLogout.do',
				{
					userid:userid
				}, function(data){
					window.location.href = "http://sso-it.foxitcloud.com/logout?service=" + foxit.common.path + "/FileMgr/login.html";
				}, 'json'
			);
		
	});
}

function getUserid(){
	var url =  document.URL;
	var para = url.substring(url.lastIndexOf("?")+1,url.length);
	var arr = para.split("=");
	console.log(arr[1]);
	return arr[1];
}
function subFrm(){
	var options = {
	    dataType: 'json',
    	iframe:	false,
	    success:function(data){
		//closeFloatBoxBg();
		console.log(data);
			if(data.fileid == 0 || data.fileid == undefined){
	    		alert("File upload failed!");
	    		window.location = window.location;
	      	}else{
	      		window.location.href = foxit.common.path + "/LoadReader.do?fileid="+data.fileid;
	      	}
   		},
   		error:function(data){
   			alert("File upload failed!");
   			window.location = window.location;
   		}
	};
	$('#frm').attr("action",foxit.common.path + "/PDFUpload.do");
    $('#frm').ajaxSubmit(options);

}
</script>
</head> 

	
	<body class="index_body_bg">
     <div class="index_body">
      <div style="float: left; width: 100%;">
      	<div class="row_top">
		<div class="title">
			<input id="logout" type="button" value="logout"></input>
		</div>
			<div class="buttom" >
				<form cssstyle="width:100%" enctype="multipart/form-data"  id="frm" name="frm" method="post" >
					<input type="file" id="upload" class="upload" name="upload">
				</form>
			</div>
		</div>
	<div class="row_top1">
		<div class="title_w20">
			<b>File Name</b>
		</div>
		<div class="title_w20">
			<b>File Size</b>
		</div>
		<div class="title_w20">
			<b>Upload User</b>
		</div>
		<div class="title_w20">
			<b>Update Time</b>
		</div>
		<div class="title_w20">
			<b>Operate</b>
		</div>
	</div>
					        <div class="index_body_main" >  
					            <div>
						            <ul class="list" id="doclist">
						            </ul>
					         	</div>
					            <div>
									<div style="padding-left:24px; padding-top:5px;">
										<div class="pagination" id="pager"></div>
									</div>
							   </div>
							 	<div class="blank0"></div>
					        </div>
						</div>
   <div style="clear: both"></div>
		</div> 
		</div>
		<!--***********************************************-->
		<div style="clear: both"></div>
		<div class="index_body" style="display: none" id="historyDiv">
      <div style="float: left; width: 100%;">
      	<div class="main_tit">历史版本</div>
     
					     <div class="main_box">
					     	<div>
					     		<ul class="list_tit">
					              <li class="fB">
					                <em class="bfb20">文件名称</em>
									<em class="bfb15">文件大小</em>
									<em class="bfb15">上传人</em>
									<em class="bfb20">更新时间</em>
									<em class="bfb25">操作</em>
					              </li>
					            </ul>
					     	</div>
					        <div class="index_body_main">  
					            <div>
						            <ul class="list" id="doclist2">
						            </ul>
					         	</div>
					            <div>
									<div style="padding-left:24px; padding-top:5px;">
										<div class="pagination" id="pager2"></div>
									</div>
							   </div>
							 	<div class="blank0"></div>
					        </div>
						</div>
   <div style="clear: both"></div>
		</div> 
		</div>

</body>
</html>
